<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Window</title>
</head>

<body>
  <script>
    function testWindow() {
      // 窗口是否全屏(有兼容问题)
      let isFullScreen = window.fullScreen;
      // console.log(isFullScreen);
      // 获取浏览器窗口的内容区域的宽度和高度
      let innerWidth = window.innerWidth;
      let innerHeight = window.innerHeight;
      // console.log(innerWidth, innerHeight);
      // 获取窗口中的帧数
      let numberOfFrames = window.length
      // console.log(numberOfFrames);
      // 获取/设置 window 对象的位置，或当前的 URL
      let location = window.location;
      // console.log(location);
      // 获取当前渲染窗口中和屏幕有关的属性
      let screen = window.screen;
      // console.log(screen);
      // 返回文档/页面，水平/垂直方向滚动的像素值(pageXOffset,pageYOffset跨浏览器兼容更好)
      let scrollX = window.scrollX;
      let scrollY = window.scrollY;
      window.pageXOffset == window.scrollX
      window.pageYOffset == window.scrollY
      // console.log(scrollX, scrollY);
      // 返回从用户浏览器视口的左边界到屏幕左侧的水平距离
      let screenLeft = window.screenLeft;
      // 返回从用户浏览器视口的顶部到屏幕顶部的垂直距离
      let screenTop = window.screenTop;
      window.screenX == window.screenLeft
      window.screenY == window.screenTop
      console.log(screenLeft, screenTop);
    }
    testWindow();
  </script>
</body>

</html>